Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set from address on placeBid call #101

Merged
merged 2 commits into from
Oct 1, 2024
Merged

Conversation

Tristan-Wilson
Copy link
Member

Description

This PR fixes the issue reported in NIT-2802 where the cargo-stylus cache bid subcommand did not set the from address on its calls, causing the zero address to be used and calls to fail due to insufficient funds.

Testing done

Reproduced the reported issue prior to the fix:

$ target/debug/cargo-stylus cargo-stylus cache bid '--endpoint=http://localhost:8547' --priv
ate-key=0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 0x11b57fe348584f0
42e436c6bf7c3c3def171de49 2                                                                 
Checking if contract can be cached...                                                       
Error: stylus cache place bid failed                                                        
                                                                                            
Caused by:                                                                                  
    other ooga booga failed to decode CacheManager error: ErrorPayload { code: -32000, messa
ge: "err: insufficient funds for gas * price + value: address 0x0000000000000000000000000000
000000000000 have 0 want 2 (supplied gas 50000000)", data: None }                           
                                                                                            
Location:                                                                                   
    main/src/cache.rs:195:13   

After the fix, it appears to get past the part it was failing on earlier:

$ target/debug/cargo-stylus cargo-stylus cache bid '--endpoint=http://localhost:8547' --private-key=0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 0x11b57fe348584f042e436c6bf7c3c3def171de49 1
Checking if contract can be cached...
Error: stylus cache place bid failed

Caused by:
    Your Stylus contract is not yet activated. To activate it, use the `cargo stylus activate` subcommand

Location:
    main/src/cache.rs:252:13

Checklist

  • I have documented these changes where necessary.
  • I have read the DCO and ensured that these changes comply.
  • I assign this work under its open source licensing.

main/src/cache.rs Outdated Show resolved Hide resolved
@Tristan-Wilson Tristan-Wilson merged commit d0663e2 into main Oct 1, 2024
7 checks passed
@Tristan-Wilson Tristan-Wilson deleted the fix-place-bid-from-addr branch October 1, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants